//
//  OMOrderRefundPriceTableCell.m
//  OMENGO_NEW
//
//  Created by 梁尚嘉 on 2017/5/16.
//  Copyright © 2017年 Kamfat. All rights reserved.
//

#import "OMOrderRefundPriceTableCell.h"
#import "OMOrderRefundDetail.h"
@interface OMOrderRefundPriceTableCell()
@property (nonatomic, strong) UILabel *elementLabel;
@property (nonatomic, strong) UILabel *priceLabel;
@property (nonatomic, strong) UILabel *statusLabel;
@end

@implementation OMOrderRefundPriceTableCell

- (void)configure
{
    [super configure];
    _elementLabel = [UILabel new];
    _elementLabel.font = SM_CFont(30);
    _elementLabel.textColor = SM_blackColor;
    _elementLabel.text = @"退款金额：";
    [self.contentView addSubview:_elementLabel];
    [_elementLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(SM_SIZE(30)));
        make.centerY.equalTo(self.contentView.mas_centerY);
    }];

    _priceLabel = [UILabel new];
    _priceLabel.font = SM_CFont(30);
    _priceLabel.textColor = SM_redColor;
    _priceLabel.text = @"￥31.00";
    [self.contentView addSubview:_priceLabel];
    [_priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.elementLabel.mas_right).offset(SM_SIZE(5));
        make.centerY.equalTo(self.contentView.mas_centerY);
    }];

    _statusLabel = [UILabel new];
    _statusLabel.font = SM_CFont(30);
    _statusLabel.textColor = SM_thumeColor;
    _statusLabel.text = @"退款中";
    [self.contentView addSubview:_statusLabel];
    [_statusLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(@(SM_SIZE(-30)));
        make.centerY.equalTo(self.contentView.mas_centerY);
    }];
}

- (void)configureCellWithObj:(OMOrderRefundDetail *)detail
{
    self.statusLabel.text = detail.status_name;
    self.priceLabel.text = [[NSString stringWithFormat:@"￥%.2f",detail.amount.floatValue] stringByReplacingOccurrencesOfString:@".00" withString:@""];
}


+ (CGFloat)cellHeight
{
    return SM_SIZE(110);
}
@end
